<template>
  <div id="userLayout" :class="['user-layout-wrapper', device]">
    <div class="container">
        <div class="header">
          {{title}}管理后台
        </div>
      <route-view></route-view>
      <div class="footer">
        Copyright &copy; 2023 {{title}}管理后台
      </div>
    </div>
  </div>
</template>

<script>
  import RouteView from "@/components/layouts/RouteView"
  import { mixinDevice } from '@/utils/mixin.js'

  export default {
    name: "UserLayout",
    components: { RouteView },
    mixins: [mixinDevice],
    data () {
      return {
        title:window._CONFIG['VUE_APP_PLATFORM_NAME']
      }
    },
    mounted () {
      document.body.classList.add('userLayout')
    },
    beforeDestroy () {
      document.body.classList.remove('userLayout')
    },
  }
</script>

<style lang="less" scoped>
  #userLayout.user-layout-wrapper {
    height: 100%;

    &.mobile {
      .container {
        .main {
          max-width: 368px;
          width: 98%;
        }
      }
    }

    .container {
      width: 100%;
      min-height: 100%;
      background: #f0f2f5 url(~@/assets/background.svg) no-repeat 50%;
      background-size: 100%;
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      a {
        text-decoration: none;
      }

      .header {
        margin-bottom: 30px;
        font-size: 30px;
        color: rgba(0, 0, 0, .85);
        font-weight: 600;
      }

      .main {
        min-width: 260px;
        width: 368px;
        margin: 0 auto;
      }

      .footer {
        position: absolute;
        width: 100%;
        bottom: 0;
        left: 0;
        padding: 30px;
        text-align: center;
        color: rgba(0, 0, 0, 0.45);
        font-size: 14px;
      }
    }
  }
</style>